package entity.mongo.security;

import enumration.AuthorityEnum;
import lombok.Data;
import org.springframework.security.core.GrantedAuthority;

/**
 * Created by zhangpingyang on 2020-01-13 21:38
 **/
@Data
public class Authority implements GrantedAuthority {

//    private String authorityId;

    private AuthorityEnum authorityName;


    @Override
    public String getAuthority() {

        return authorityName.name();
    }

    public Authority() {
    }

    public Authority(AuthorityEnum authorityName) {
        this.authorityName = authorityName;
    }
}
